package dev.mrchen.flows.core;

public class WrapData {

    public static final WrapData NULL = new WrapData(null);

    private final Object target;

    public WrapData(Object target) {
        this.target = target;
    }

    public String asString() {
        if ( null == target ) {
            return null;
        }
        return target.toString();
    }


    public <T> T asValue( Class<T> type ) {
        if ( null == target ) {
            return null;
        }
        if ( target.getClass().isAssignableFrom(type) ) {
            return (T) target;
        }
        //TODO
        throw new UnsupportedOperationException();
    }



}
